import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import MintUI from 'mint-ui'
import Vant from 'vant'
import BaiduMap from 'vue-baidu-map'
import 'vant/lib/index.css'
import 'amfe-flexible' // 导入rem适配插件
import 'mint-ui/lib/style.css'
// import $ from 'jquery'
// 加载全局样式
import './styles/index.less'
// 导入vue-router
import Router from 'vue-router'
// 导入处理时间的插件
import './utils/dayjs'

// 解决跳转相同路由问题 vue/cli3 会出现的问题
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

router.afterEach((to, from, next) => {
  window.scrollTo(0, 0);
})

Vue.config.productionTip = false
Vue.use(MintUI)
Vue.use(Vant)
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'oNd0KclyUI26dkKCxsqE2WsFX8KDyG9T'
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
